package school;
import java.util.ArrayList;
import java.util.Random;
public class Run {
    public static void main(String[] args) {
       ClassRoom classRoom = new ClassRoom("java班");
       Group group1 = new Group(1);
       Group group2 = new Group(2);
       group1.addstudent(new Student("宗义",1));
        group1.addstudent(new Student("王五",2));
        group2.addstudent(new Student("老刘",3));
        group2.addstudent(new Student("漆黑",4));
        classRoom.addGroup(group1);
        classRoom.addGroup(group2);
        //随机抽取小组
        Group randomGroup = classRoom.getRandomGroup();
        System.out.println("随机抽取小组的id为" + randomGroup.getGroupId());
        //随机从小组中抽取学生
        Student randomStudentFromGroup = classRoom.getRandomStudentFromGroup(randomGroup);
        System.out.println("随机抽取的小组中的学生: " + randomStudentFromGroup.getName());
        //随机从班级抽取学生
        Student randomStudentFromClass = classRoom.getRandomStudentFromClass();
        System.out.println("随机从全班抽取的学生: " + randomStudentFromClass.getName());
    }
}
